package com.example.basicdemo.model.builder;

import com.isyscore.os.dev.api.IsyscoreRequestBuilder;
import com.isyscore.os.dev.util.IsyscoreHashMap;
import com.isyscore.os.dev.util.RequestUtils;

import javax.servlet.http.HttpServletRequest;

public class OsLoginStatusRequestBuilder extends IsyscoreRequestBuilder {
    private IsyscoreHashMap headers;

    /**
     * 是否从缓存中获取，默认为 true。true：从缓存中获取；false：不从缓存中获取
     */
    private Boolean useCache;


    public IsyscoreHashMap getHeaders() {
        return headers;
    }

    public OsLoginStatusRequestBuilder setHeaders(IsyscoreHashMap headers) {
        this.headers = headers;
        return this;
    }

    @Override
    public boolean validate() {
        return true;
    }

    @Override
    public IsyscoreRequestBuilder setRequestHeader(HttpServletRequest request) {
        this.headers = RequestUtils.getRequestHeader(request);
        return this;
    }
}
